package collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo2 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("张三丰");
        list.add("张翠山");
        list.add("张无忌");
        System.out.println("list = " + list);


        Object[] objs = list.toArray();
        for (int i = 0; i < objs.length; i++) {
            String obj = ((String)  objs[i]);
            System.out.println("obj = " + obj);
        }
    }
}
